$('#tickets').html("<%= escape_javascript(render 'admin/topics/ticket') %>");
$('.ticket-stats').html("<%= j render partial: 'admin/topics/tiny' %>");
$('#ticket-page-title').html("").hide();
$(document).prop('title', "<%= admin_title %> <%= t(:discussions, default: 'Discussions') %>: #<%= @topic.id %> <%= @topic.name.titleize %>");

// Update timestamps
$('.last-active time[data-time-ago]').timeago();

// Empty ticket search field and hide
$('q').val('');

// Send ping to GA
ga('send', 'pageview');

// jQuery hook
Helpy.ready();
Helpy.track();
Helpy.logHistory();
Helpy.ticketMenu();

// Escape from reply field
newpost = document.getElementById('new_post');
Mousetrap(newpost).bind('escape', function(e, combo) {
  $('#post_body').blur();
});

// RTL changes?
<%= "Helpy.rtl();" if rtl? %>
